<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- elementUicss -->
    <link rel="stylesheet" href="./css/index.css">
    <!-- 自定义样式 -->
    <link rel="stylesheet" href="./css/zhCss.css">
</head>
<style>

</style>


<body>
    <div id="app" :class="{'showBg':!showLogin}">

        <!-- 登录模块 -->
        <div class="login-container" v-if="showLogin">
            <h2 class="title">登录</h2>
            <el-form class="login-form" :model="loginForm" ref="loginForm" label-width="80px">
                <el-form-item label="用户名">
                    <el-input v-model="loginForm.phone" placeholder="请输入用户名"></el-input>
                </el-form-item>
                <el-form-item label="密码">
                    <el-input type="password" v-model="loginForm.password" placeholder="请输入密码"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button class="login-button" type="primary" @click="login">登录</el-button>
                </el-form-item>
            </el-form>
        </div>

        <!-- 选择类型模块 -->
        <div class="seletType" v-if="!showLogin && !selected">
            <div class="radio">
                <el-radio v-model="authType" label="1">司机认证</el-radio>
                <el-radio v-model="authType" label="2">车辆认证</el-radio>
                <el-radio v-model="authType" label="3">手机号注册</el-radio>
            </div>
            <el-button style="margin-top: 50px;width: 150px;" type="primary" @click="selected = true">确定</el-button>
        </div>

        <!-- 左上角返回按钮 -->
        <i class="el-icon-back backbtn" v-if="selected" @click="back"></i>

        <!-- 手机号注册模块 -->
        <div class="uploadArea" v-if="selected && authType == 3" style="flex-direction: column;">
            <div class="item" style="margin: 0;margin-bottom: 30px;">
                <el-form :rules="loginPhoneRules" class="upload-input" :model="registerDate" ref="registerDate" label-width="80px">
                    <el-form-item label="手机号" prop="phone">
                        <el-input v-model="registerDate.phone" placeholder="请输入注册的手机号"></el-input>
                    </el-form-item>
                </el-form>

            </div>
            <div style="width:100%;text-align: center;">
                <el-button v-if="selected" type="primary" @click="registerPhone('registerDate')" style="width: 150px;">注册</el-button>
            </div>
        </div>

        <!-- 司机上传认证模块 -->
        <div class="uploadArea" v-if="selected && authType == 1">
            <div class="item">
                <upload-img type="0" title="身份证人像面" ref="idCardFront"></upload-img>
                <upload-img title="身份证国徽面" ref="idCardEnd"></upload-img>
                <el-form :rules="rulesAriver" class="upload-input" :model="driverData.idCard" ref="idCardData" label-width="80px">
                    <el-form-item label="姓名" prop="name">
                        <el-input v-model="driverData.idCard.name" placeholder="请输入用户名"></el-input>
                    </el-form-item>
                    <el-form-item label="身份证号" prop="idNum">
                        <el-input type="text" v-model="driverData.idCard.idNum" placeholder="请输入身份证号"></el-input>
                    </el-form-item>
                </el-form>
            </div>
            <div class="item">
                <upload-img type="2" title="驾驶证主页" ref="driverCardMain"></upload-img>
                <upload-img title="驾驶证副页" ref="driverCardSecond"></upload-img>
                <el-form :rules="rulesArive" class="upload-input" :model="driverData.driverCardData" ref="driverCardData"
                    label-width="80px" >
                    <el-form-item label="驾驶证号" prop="cardNum">
                        <el-input type="text" v-model="driverData.driverCardData.cardNum"
                            placeholder="请输入驾驶证号"></el-input>
                    </el-form-item>
                    <el-form-item label="手机号" prop="tel">
                        <el-input type="text" v-model="driverData.driverCardData.tel" placeholder="请输入手机号"></el-input>
                    </el-form-item>
                </el-form>
            </div>
            <div class="item">
                <upload-img title="驾驶证副页反面" ref="driverCardSecondEnd"></upload-img>
                <upload-img title="从业资格证" ref="bussinessCard"></upload-img>
            </div>
            <div style="width:100%;display:flex;justify-content: center;">
                <el-button type="primary" @click="driverCertification" style="width: 150px;">提交审核</el-button>
            </div>
        </div>

        <!-- 车辆上传认证模块 -->
        <div class="uploadArea" v-if="selected && authType == 2">
            <div class="item">
                <upload-img title="行驶证主页" ref="driverCardMain"></upload-img>
                <upload-img title="行驶证副页" ref="driverCardSecond"></upload-img>
                <el-form :rules="carRules" class="upload-input" :model="carData.carInfo" ref=" " label-width="100px">
                    <el-form-item label="车牌号" prop="carNum">
                        <el-input v-model="carData.carInfo.carNum" placeholder="请输入车牌号"></el-input>
                    </el-form-item>
                    <el-form-item label="车辆类型" prop="carType">
                        <el-input type="text" v-model="carData.carInfo.carType" placeholder="请输入车辆类型"></el-input>
                    </el-form-item>
                    <el-form-item label="车架号" prop="carFrameNum">
                        <el-input type="text" v-model="carData.carInfo.carFrameNum" placeholder="请输入车架号"></el-input>
                    </el-form-item>
                    <el-form-item label="汽车品牌" prop="carBrand">
                        <el-input type="text" v-model="carData.carInfo.carBrand" placeholder="请输入汽车品牌"></el-input>
                    </el-form-item>
                    <el-form-item label="牵引总质量" prop="weight">
                        <el-input type="text" v-model="carData.carInfo.weight" placeholder="请输入牵引总质量(kg)"></el-input>
                    </el-form-item>
                    <el-form-item label="使用性质" prop="carUsefor">
                        <el-input type="text" v-model="carData.carInfo.carUsefor" placeholder="请输入车辆用途"></el-input>
                    </el-form-item>
                    <el-form-item label="车辆颜色" prop="carColor">
                        <el-select v-model="carData.carInfo.carColor" placeholder="请选择">
                            <el-option v-for="item in carInfo.carColor" :key="item.key" :label="item.name"
                                :value="item.key">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="能源类型" prop="energyType">
                        <el-select v-model="carData.carInfo.energyType" placeholder="请选择">
                            <el-option v-for="item in carInfo.energyType" :key="item.key" :label="item.name"
                                :value="item.key">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-form>
            </div>
            <div class="item">
                <el-form :rules="carAllRules" class="upload-input" :model="carData.carOwner" ref="loginForm" label-width="80px">
                    <el-form-item label="所有人" prop="owner">
                        <el-input type="text" v-model="carData.carOwner.owner" placeholder="请输入所有人姓名"></el-input>
                    </el-form-item>
                    <el-form-item label="发证日期" prop="sendDate">
                        <el-input type="text" v-model="carData.carOwner.sendDate" placeholder="请输入发证日期"></el-input>
                    </el-form-item>
                    <el-form-item label="注册日期" prop="registerDate">
                        <el-input type="text" v-model="carData.carOwner.registerDate" placeholder="请输入注册日期"></el-input>
                    </el-form-item>
                    <el-form-item label="发证单位" prop="company">
                        <el-input type="text" v-model="carData.carOwner.company" placeholder="请输入发证单位"></el-input>
                    </el-form-item>
                    <el-form-item label="地址" prop="address">
                        <el-input type="text" v-model="carData.carOwner.address" placeholder="请输入地址"></el-input>
                    </el-form-item>
                    <el-form-item label="手机号" prop="tel">
                        <el-input type="text" v-model="carData.carOwner.tel" placeholder="请输入手机号"></el-input>
                    </el-form-item>
                </el-form>
            </div>
            <div class="item">
                <!-- <p style="margin: 10px;">道路运输许可证号</p> -->
                <el-form :rules="roadRules" class="upload-input" :model="carData.roadData" ref="loginForm" label-width="80px">
                    <el-form-item label="交运管" prop="area">
                        <el-select v-model="carData.roadData.area" placeholder="请选择">
                            <el-option v-for="(item,index) in carInfo.area" :key="index" :label="item" :value="item">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="字" prop="code">
                        <el-input type="text" v-model="carData.roadData.code" placeholder="请输入字"></el-input>
                    </el-form-item>
                    <el-form-item label="号码" prop="number">
                        <el-input type="text" v-model="carData.roadData.number" placeholder="请输入号码"></el-input>
                    </el-form-item>
                </el-form>
            </div>
            <div class="item">
                <upload-img title="行驶证副页反面" ref="driverCardSecondEnd"></upload-img>
                <upload-img title="挂车行驶证主页" ref="carDriverMain"></upload-img>
                <upload-img title="道路运输证" ref="transportCard"></upload-img>
            </div>
            <div style="width:100%;display:flex;justify-content: center;">
                <el-button type="primary" @click="carCertification" style="width: 150px;">提交审核</el-button>
            </div>
        </div>



    </div>

    <!-- 图片上传组件 -->
    <template id="upload">
        <div class="uploadImg">
            <p class="title">{{title}}</p>
            <el-upload class="avatar-uploader" :action="uploadUrl" :headers="headers" :show-file-list="false"
                :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload" :disabled="!!imageUrl">
                <!-- <img v-if="imageUrl" :src="imageUrl" class="avatar"> -->
                <el-image v-if="imageUrl" :src="imageUrl" class="avatar" ref="imgTarget" :preview-src-list="[imageUrl]">
                </el-image>
                <div class="mask" v-if="imageUrl">
                    <i class="icon el-icon-zoom-in" style="margin-right: 50px;" @click.stop="previewImg"></i>
                    <i class="icon el-icon-delete" @click.stop="deleteImg"></i>
                </div>
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
            <el-dialog :visible.sync="preivew">
                <img width="100%" :src="imageUrl" alt="">
            </el-dialog>
        </div>

    </template>
</body>
<script src="./js/vue.js"></script>
<script src="./js/index.js"></script>
<script src="./js/md5.min.js"></script>
<script src="./js/jquery.min.js"></script>
<script src="./js/main.js"></script>
<script src="./js/api.js"></script>
<script>
    let driverData={
        idCard: {
            name: '',//司机姓名
            idNum: '',//身份证号
        },
        driverCardData: {
            cardNum: '',//驾驶证号
            tel: '',//手机号
        }
    }

    //图片上传组件
    Vue.component('UploadImg', {
        props: ['title','type'],
        data() {
            return {
                // imageUrl: 'https://pica.zhimg.com/80/v2-8c1fbe93975e4ef94b5845bbbabb75f2_720w.webp',
                imageUrl: '',
                uploadUrl: UPLOADURL,
                headers: getHeader(),
                preivew: false,
            }
        },
        template: '#upload',
        mounted() {

        },
        methods: {
            async handleAvatarSuccess(res, file) {
                if (res.code == 200) {
                    
                    this.imageUrl = res.data.url;
                    
                    if(this.type === '0' || this.type === '2'){
                        let result=await tellInfo({
                            img:res.data.url,
                            type:this.type,
                        })
                        if(result.code !==200){
                            V.$message({
                                message: result.msg,
                                type: 'error'
                            });
                            return
                        }
                        if(this.type === '0'){
                            driverData.idCard.name = result.data.Name;
                            driverData.idCard.idNum = result.data.IDNumber;
                        }else if(this.type === '2'){
                            driverData.driverCardData.cardNum = result.data.idCardNumber;

                        }
                    }
                    
                }
            },

            beforeAvatarUpload(file) {
                const isJPG = file.type === 'image/jpeg';
                const isLt2M = file.size / 1024 / 1024 < 2;
            },
            previewImg() {
                this.$refs.imgTarget.$el.querySelector('img').click();
            },
            deleteImg() {
                this.$confirm('确定要删除图片吗?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.$message({
                        type: 'success',
                        message: '删除成功!'
                    });
                    this.imageUrl = '';
                }).catch(() => {
                    // this.$message({
                    //     type: 'info',
                    //     message: '已取消删除'
                    // });
                });
            }
        }
    });

    //核心逻辑
    var V = new Vue({
        el: '#app',
        data() {
            var validatePhone = (rule, value, callback) => {
                if (!/^1(3[0-9]|4[5,7]|5[0,1,2,3,5,6,7,8,9]|6[0-9]|7[0-9]|8[0-9]|9[0-9])\d{8}$/.test(value)) {
                  callback(new Error('请输入正确的手机号格式'));
                } else {
                  callback();
                }
            };
            return {
                authType: '1',//1：司机认证 2：车辆认证 3：手机号注册
                selected: false,//是否选择过

                //是否登录表示
                showLogin: true,

                //登录模块相关填报信息
                loginForm: {
                    phone: '',
                    password: ''
                },

                //注册手机号相关
                registerDate: {
                    phone: '',//注册的手机号
                },
                //司机认证相关填报数据
                driverData:driverData,
                // driverData: {
                //     idCard: {
                //         name: '',//司机姓名
                //         idNum: '',//身份证号
                //     },
                //     driverCardData: {
                //         cardNum: '',//驾驶证号
                //         tel: '',//手机号
                //     }
                // },
                //车辆认证相关填报数据
                carData: {
                    //车辆详情信息
                    carInfo: {
                        carNum: '',//车牌号
                        carType: '',//车辆类型
                        carFrameNum: '',//车架号
                        carBrand: '',//汽车品牌
                        weight: '',//牵引总质量
                        carUsefor: '',//使用性质
                        carColor: '',//使用性质
                        energyType: '',//使用性质
                    },
                    //车辆主人信息
                    carOwner: {
                        owner: '',//所有人信息
                        sendDate: '',//发证日期
                        registerDate: '',//注册日期
                        company: '',//发证单位
                        address: '',//地址
                        tel: '',//手机号
                    },
                    //道路运输许可证
                    roadData: {
                        area: '',//交运管信息
                        code: '',//字
                        number: '',//号码
                    }

                },
                //车辆认证公用数据
                carInfo: {
                    carColor: [],//车辆颜色
                    energyType: [],//能源类型
                    area: [],//各省交运管
                },
                rulesAriver:{
                    name:[
                        { required: true, message: '请输入司机姓名', trigger: ['blur', 'change'] },
                    ],
                    idNum:[
                        { required: true, message: '请输入身份证号', trigger: ['blur', 'change'] },
                        { min: 18, max: 18, message: '长度在18个字符', trigger: ['blur', 'change'] }
                    ]
                },
                rulesArive:{
                    cardNum:[
                        { required: true, message: '请输入驾驶证号', trigger: ['blur', 'change'] },
                    ],
                    tel:[
                        { required: true, message: '请输入手机号', trigger: 'blur' },
                    ]
                },
                carRules:{
                    carNum:[
                        { required: true, message: '请输入车牌号', trigger: ['blur', 'change'] },
                    ],
                    carType:[
                        { required: true, message: '请输入车辆类型', trigger: ['blur', 'change'] },
                    ],
                    carFrameNum:[
                        { required: true, message: '请输入车架号', trigger: ['blur', 'change'] },
                    ],
                    carBrand:[
                        { required: true, message: '请输入汽车品牌', trigger: ['blur', 'change'] },
                    ],
                    weight:[
                        { required: true, message: '请输入牵引质量', trigger: ['blur', 'change'] },
                    ],
                    carUsefor:[
                        { required: true, message: '请输入使用性质', trigger: ['blur', 'change'] },
                    ],
                    carColor:[
                        { required: true, message: '请输入车辆颜色', trigger: ['blur', 'change'] },
                    ],
                    energyType:[
                        { required: true, message: '请输入能源类型', trigger: ['blur', 'change'] },
                    ]
                },
                carAllRules:{
                    owner:[
                        { required: true, message: '请输入所有人', trigger: ['blur', 'change'] },
                    ],
                    sendDate:[
                        { required: true, message: '请输入发证日期', trigger: ['blur', 'change'] },
                    ],
                    registerDate:[
                        { required: true, message: '请输入注册日期', trigger: ['blur', 'change'] },
                    ],
                    company:[
                        { required: true, message: '请输入发证单位', trigger: ['blur', 'change'] },
                    ],
                    address:[
                        { required: true, message: '请输入地址', trigger: ['blur', 'change'] },
                    ],
                    tel:[
                        { required: true, message: '请输入手机号', trigger: ['blur', 'change'] },
                    ]
                },
                roadRules:{
                    area:[
                        { required: true, message: '请输入交运管', trigger: ['blur', 'change'] },
                    ],
                    code:[
                        { required: true, message: '请输入字', trigger: ['blur', 'change'] },
                    ],
                    number:[
                        { required: true, message: '请输入号码', trigger: ['blur', 'change'] },
                    ],
                },
                loginPhoneRules:{
                    phone: [
                        { validator: validatePhone, trigger: ['blur', 'change'] }
                    ],
                },
                

            };
        },
        mounted() {
            this.afterLogin();
        },
        methods: {
            async login() {
                // 在此处编写登录逻辑
                if (!this.loginForm.phone || !this.loginForm.password) {
                    this.$message({
                        message: '信息不完整',
                        type: 'error'
                    });
                    return;
                }


                let result = await userLogin(this.loginForm);
                if (result.code == 200) {
                    //登陆成功
                    this.$message({
                        message: result.msg,
                        type: 'success'
                    });
                    //存储登陆状态
                    setLoginState(result.data);
                    this.afterLogin();
                } else {
                    this.$message({
                        message: result.msg,
                        type: 'error'
                    });
                }
            },
            //登陆过后拿到相关车辆数据
            async afterLogin() {
                if (isLogin()) {
                    //登陆过了 显示认证页
                    this.showLogin = false;
                    //获取加密请求头
                    this.headers = getHeader();
                    //获取车辆相关填报信息
                    let result = await getConfig();
                    if (result.code == 200) {
                        this.carInfo.carColor = result.data.colorList;
                        this.carInfo.energyType = result.data.energyList;
                        this.carInfo.area = result.data.province;
                    }
                }
            },
            back() {
                this.selected = false;
                //重置注册手机号相关填报数据
                this.registerDate = {
                    tel:'',
                }
                //重置司机认证相关填报数据
                this.driverData = {
                    idCard: {
                        name: '',//司机姓名
                        idNum: '',//身份证号
                    },
                    driverCardData: {
                        cardNum: '',//驾驶证号
                        tel: '',//手机号
                    }
                };
                //重置车辆认证相关填报数据
                this.carData = {
                    //车辆详情信息
                    carInfo: {
                        carNum: '',//车牌号
                        carType: '',//车辆类型
                        carFrameNum: '',//车架号
                        carBrand: '',//汽车品牌
                        weight: '',//牵引总质量
                        carUsefor: '',//使用性质
                        carColor: '',//使用性质
                        energyType: '',//使用性质
                    },
                    //车辆主人信息
                    carOwner: {
                        owner: '',//所有人信息
                        sendDate: '',//发证日期
                        registerDate: '',//注册日期
                        company: '',//发证单位
                        address: '',//地址
                        tel: '',//手机号
                    },
                    //道路运输许可证
                    roadData: {
                        area: '',//交运管信息
                        code: '',//字
                        number: '',//号码
                    }

                };
            },
            //注册手机号
            async registerPhone(formName) {
                this.$refs[formName].validate(async (valid) => {
                    if (!valid) {
                        this.$message({
                        message: '请输入正确的手机号',
                        type: 'error'
                    });
                        return false;
                    }
                    let option = {
                        tel: this.registerDate.phone
                    }
                    let result = await registerPhone(option);
                    if(result.code == 200){
                        this.$message({
                            message: result.msg,
                            type: 'success'
                        });
                        this.back();
                    }else{
                        this.$message({
                            message: result.msg,
                            type: 'error'
                        });
                    }
                });
                // if (!this.registerDate.phone) {
                //     this.$message({
                //         message: '请输入手机号',
                //         type: 'error'
                //     });
                //     return;
                // };
                
            },
            //司机认证
            async driverCertification() {
                //判断文本框信息
                let rule = this.judgeDataEmpty(this.driverData);
                if (rule.length > 0) {
                    this.$message({
                        message: '司机认证信息不完整',
                        type: 'error'
                    });
                    return;
                }

                //判断图片信息
                let uploadImgNams = ['idCardFront', 'idCardEnd', 'driverCardMain',
                    'driverCardSecond', 'driverCardSecondEnd', 'bussinessCard'];
                let imgRule = uploadImgNams.every(item => {
                    return this.$refs[item].imageUrl
                })
                if (!imgRule) {
                    this.$message({
                        message: '司机图片上传不完整',
                        type: 'error'
                    });
                    return;
                }

                //获取认证数据
                let option = {
                    cyzgz: this.$refs.bussinessCard.imageUrl,//从业资格证
                    jszz: this.$refs.driverCardMain.imageUrl,//驾驶证正面
                    jszfz: this.$refs.driverCardSecond.imageUrl,//驾驶证副页正面
                    jszfb: this.$refs.driverCardSecondEnd.imageUrl,//驾驶证副页背面面
                    sfzimgz: this.$refs.idCardFront.imageUrl,//身份证正面
                    sfzimgb: this.$refs.idCardEnd.imageUrl,//身份证国徽面

                    jszh: this.driverData.driverCardData.cardNum,//驾驶证号
                    sfz: this.driverData.idCard.idNum,//身份证号
                    user_name: this.driverData.idCard.name,//真实姓名
                    tel: this.driverData.driverCardData.tel,//手机号
                }

                let result = await driverCertification(option);
                if (result.code == 200) {
                    this.$message({
                        message: result.msg,
                        type: 'success'
                    });
                    this.back();
                } else {
                    this.$message({
                        message: result.msg,
                        type: 'error'
                    });
                }

            },
            //车辆认证
            async carCertification() {
                // //判断文本框信息
                let rule = this.judgeDataEmpty(this.carData);
                if (rule.length > 0) {
                    this.$message({
                        message: '车辆认证信息不完整',
                        type: 'error'
                    });
                    return;
                }
                //判断图片信息
                let uploadImgNams = ['driverCardMain', 'driverCardSecond', 'driverCardSecondEnd',
                    'carDriverMain', 'transportCard'];
                let imgRule = uploadImgNams.every(item => {
                    return this.$refs[item].imageUrl
                });
                if (!imgRule) {
                    this.$message({
                        message: '车辆图片上传不完整',
                        type: 'error'
                    });
                    return;
                }
                let option = {
                    xszz: this.$refs.driverCardMain.imageUrl,//行驶证主页
                    xszf: this.$refs.driverCardSecond.imageUrl,//行驶证副页
                    xszff: this.$refs.driverCardSecond.imageUrl,//行驶证副页反面
                    guaimg: this.$refs.carDriverMain.imageUrl,//挂车行驶证
                    ysjyxkz: this.$refs.transportCard.imageUrl,//道路运输证

                    cph: this.carData.carInfo.carNum,//车牌号
                    car_lx: this.carData.carInfo.carType,//车辆类型
                    car_jh: this.carData.carInfo.carFrameNum,//车架号
                    car_pp: this.carData.carInfo.carBrand,//汽车品牌
                    syxz: this.carData.carInfo.carUsefor,//使用性质
                    kzz: this.carData.carInfo.weight,//牵引总质量
                    color: this.carData.carInfo.carColor,//汽车颜色
                    energy: this.carData.carInfo.energyType,//能源类型

                    syr: this.carData.carOwner.owner,//所有人
                    IssueDate: this.carData.carOwner.sendDate,//发证日期
                    RegisterDate: this.carData.carOwner.registerDate,//注册日期
                    address: this.carData.carOwner.address,//地址
                    tel: this.carData.carOwner.tel,//手机号

                    jiaoyunguan: this.carData.roadData.area,//交运管
                    zi: this.carData.roadData.code,//字
                    dlys_num: this.carData.roadData.number,//地址
                }
                // let option = {
                //     xszz: 'http://img.zhgylgl.com/2024/03/4a47a0202403121530508638.png',
                //     xszf: 'http://img.zhgylgl.com/2024/03/fb5c812024031215305348850.png',
                //     xszff: 'http://img.zhgylgl.com/2024/03/fb5c812024031215305348850.png',
                //     guaimg: 'http://img.zhgylgl.com/2024/03/d3e0b7202403121531007360.png',
                //     ysjyxkz: 'http://img.zhgylgl.com/2024/03/aebac52024031215310248895.png',
                //     cph: 123,
                //     car_lx: 'byd',
                //     car_jh: 'EF',
                //     car_pp: '比亚迪',
                //     syxz: '拉货',
                //     kzz: 1000,
                //     color: 5,
                //     energy: 'E',
                //     syr: '张三',
                //     IssueDate: 2024,
                //     RegisterDate: 202,
                //     address: '中豪集团',
                //     tel: 18790857236,
                //     jiaoyunguan: '晋',
                //     zi: 11,
                //     dlys_num: 'D大调',
                // }
                let result = await carCertification(option);
                if (result.code == 200) {
                    this.$message({
                        message: result.msg,
                        type: 'success'
                    });
                    this.back();
                } else {
                    this.$message({
                        message: result.msg,
                        type: 'error'
                    });
                }

            },
            //判断对象所有项是否有值
            judgeDataEmpty(obj, arr = []) {
                //先判断输入框信息是否完整
                for (let key in obj) {
                    if (typeof obj[key] == 'object') {
                        this.judgeDataEmpty(obj[key], arr)
                    } else {
                        if (obj[key] == '') {
                            //值为空
                            arr.push(key);
                        }
                    }
                }
                return arr
            }
        }
    });

</script>

</html>